import React from 'react';
import StaffItem from './StaffItem';
import PropTypes from 'prop-types';
export default class StaffItemPanel extends React.Component {
    render(){
        let items =[];
        if(this.props.items.length == 0){
            items.push(<tr><td colSpan="3" className="tempEmpty">暂无用户</td></tr>)
        }
        else{
            this.props.items.forEach((item,key)=>{
                items.push(<StaffItem key={key} item={item}/>)
            })
        }
        return (
            <table className="ui-table">
                <thead>
                    <tr>
                    <th>昵称</th>
                    <th>年龄</th>
                    <th>性别</th>
                    <th>描述</th>
                    </tr>
                </thead>
                <tbody>
                    {items}
                </tbody>
            </table>
        )
    }
}
StaffItemPanel.propTypes ={
    items:PropTypes.array
}